<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: ll
  Date: 2022/9/19
  Time: 11:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"  %>
<html>
<head>
    <title>Title</title>
    <script src="webjars/jquery/3.6.1/dist/jquery.min.js"></script>
    <link rel="stylesheet" href="webjars/bootstrap/3.4.1/dist/css/bootstrap.min.css">
    <script src="webjars/bootstrap/3.4.1/dist/js/bootstrap.min.js"></script>
</head>

<body>
<div class="container">
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h2 class="panel-title">
                <h3>
                    商品信息
                </h3>
            </h2>
        </div>
        <table class="table table-hover">
            <!-- On rows -->
            <tr class="active">
                <td>id</td>
                <td>名称</td>
                <td>单价</td>
                <td>购买数</td>
                <td>操作</td>
            </tr>
            <%--         <tr class="success">...</tr>--%>
            <%--         <tr class="warning">...</tr>--%>
            <%--         <tr class="danger">...</tr>--%>
            <%--         <tr class="info">...</tr>--%>

            <!-- On cells (`td` or `th`) -->
            <c:forEach items="${products}" var="p">
                <tr>
                    <td class="active">${p.value.pid}</td>
                    <td class="success">${p.value.pname}</td>
                    <td class="warning">${p.value.price}</td>
                    <td> ${p.value.quantity}</td>
                    <td>
                        <a href="/index?cmd=add&pid=${p.value.pid}" class="btn btn-success btn-sm">购买</a>
                    </td>
                </tr>
            </c:forEach>
        </table>
        <div class="panel-footer text-right">
            小小店铺
        </div>
    </div>
</div>
</body>
</html>
